<template>
	<view class="content">
		<text style="font-size:50rpx; ">子组件A</text>
		<view class="coma_box">
			<text>父组件传进来的值：</text>
			<text style="font-weight: bold;color: red;">{{intent}}</text>
		</view>
		<button type="primary" @click="sent2Bro">传值给ComB组件</button>
	</view>
</template>

<script>
	export default {
		name:"ComA",
		// props:{
		// 	intent:{
		// 		type:String,
		// 		default:"hello",
		// 		require
		// 	}
		// },
		props:['intent','xxx'],
		data() {
			return {
				
			};
		},
		created() {
			console.log("created comA");
		},
		mounted() {
			console.log("mounted comA");
		},
		methods:{
			sent2Bro(){
				console.log("sent2Bro");
				uni.$emit("fasong",this.intent);
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		height: 300rpx;
		background-color: #F0AD4E;
		margin: 50rpx;

	}

	.coma_box {
		flex-direction: row;
		align-items: flex-start;
		width: 100%;
	}

	button {
		margin: 50rpx;
	}
</style>